<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="http://localhost/e-shop/xiangqu/Application/Index/View/User/css/user.css"/>
		<script type="text/javascript" src="http://localhost/e-shop/xiangqu/Static/uploadify/jquery-1.8.2.min.js"></script>
		<script type="text/javascript">
			var alter = "<?php echo U('Index/User/alter');?>"
		</script>
		<script type="text/javascript" src="http://localhost/e-shop/xiangqu/Static/uploadify/jquery.uploadify.min.js"></script>
		<script src="http://localhost/e-shop/xiangqu/Application/Index/View/User/js/user.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<!--头部固定区-->
		<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!--头部固定区-->
<style type="text/css">
	#header .header_content .logined a{
		font: 400 14px/50px "微软雅黑";
	}
</style>
		<div id="header_fixed"></div>
		<div id="header">
			<div class="header_content">
				<div class="logo"><img src="http://localhost/e-shop/xiangqu/Application/Index/View/User/images/logo.png" alt="" /></div>
				<?php if(!isset($_SESSION['username'])): ?>
				<div class="login">
					<!--<a href=""><span></span></a>-->
					<a href="<?php echo U(('Index/Register/index'));?>">注册</a>
					<a href="<?php echo U(('Index/Login/index'));?>">登录</a>
				</div>
				<?php else:  ?>
				<!--已登录begin-->
				<div class="logined">
					<a href="<?php echo U('out');?>">退出</a>
					<a href="<?php echo U('Index/Orders/myOrder');?>">我的订单</a>
					<a href="<?php echo U('Index/Carts/index');?>">购物车</a>
					<a href="<?php echo U('Index/User/index');?>"><?php echo $_SESSION['nick'] ?></a>
					<a href="<?php echo U('Index/Orders/myOrder');?>" class="face"><img src="http://localhost/e-shop/xiangqu/<?php echo $face;?>" alt="" /></a>
				</div>
				<!--已登录end-->
				<?php endif  ?>
			</div>
		</div>
		<!--头部end-->
		<!--菜单栏begin-->
		<div id="nav">
			<div class="nav_content">
				<a href="<?php echo U('Index/Index/index');?>">首页</a>
				<?php foreach ($navData as $k=>$v){?>
				<a href="<?php echo U('Index/List/index',array('cid'=>$v[cid]));?>"><?php echo $v['cname'];?></a>
				<?php }?>
				<div class="search">
					<form action="<?php echo U('Index/Search/index');?>" method="get">
						<input type="text" class="text" name="keys" placeholder="搜索" />
						<input type="submit" class="sbt" value=""/>
					</form>
				</div>
			</div>
		</div>
		<!--菜单栏end-->
		<!--菜单栏end-->

		<!--页面主体区域begin-->
		<div id="container">
			<div class="usersite">
				<h1>个人设置</h1>
				<div class="site_cont">
					<form action="" method="post" enctype="multipart/form-data">
						<ul>
							<!--<input id="pic" type="file" multiple="true" name="thumb" class="i_face">-->
							<li class="face">
								<span>头像：</span>
								<img src="http://localhost/e-shop/xiangqu/<?php echo $oldData['face'];?>" class="my_face"/>
								<div href="" class="d_face">
									<input id="pic" type="file" multiple="true" name="thumb" class="i_face">
								</div>
								<script type="text/javascript">
					                $(function() {
					                    $('#pic').uploadify({
					                        'formData'     : {//POST数据
					                            '<?php echo session_name();?>' : '<?php echo session_id();?>',
					                        },
					                        'fileTypeDesc' : '上传文件',//上传描述
					                        'fileTypeExts' : '*.jpg;*.png',
					                        'swf'      : 'http://localhost/e-shop/xiangqu/Static/uploadify/uploadify.swf',
					                        'uploader' : '<?php echo U("upload");?>',//执行控制器上的上传类
					                        'buttonText':'重新上传头像',
					                        'fileSizeLimit' : '2000KB',
					                        'uploadLimit' : 1,//上传文件数
					                        'width':100,
					                        'height':80,
					                        'successTimeout':10,//等待服务器响应时间
					                        'removeTimeout' : 0.2,//成功显示时间
					                        'onUploadSuccess' : function(file, data, response) {
					                            data=$.parseJSON(data);
					                            var imageUrl = data.image?data.url:'http://localhost/e-shop/xiangqu/Static/image/default.png';
					                            var hiddenInput="<input type='hidden' name='face' value='"+data.path+"'>";
					                            $(".my_face").attr('src',imageUrl);
					                            $('.face').append(hiddenInput);
					                        }
					                    });
					                });
					            </script>
					            </li>
							<li class="userid">
								<div class="u">
									<span class="u_s1">账号：</span>
									<span class="u_s2"><?php echo $oldData['username'];?></span>
									<span class="u_s3">修改密码</span>
								</div>
								<div class="alter">
									<div class="al_cont">
										<div class="old">
											<span>当前密码：</span>
											<input type="text" name="oldpass" class="oldp" />
										</div>
										<div class="new">
											<span>新密码：</span>
											<input type="text" class="newp" name="newpass" />
										</div>
										<div class="confirm">
											<span>确认密码：</span>
											<input type="text" class="confp" name="newpass" />
										</div>
										<div class="submit">
											<p type="reset" value='取消' class="rst" />取消</p>
											<p type="submit" value="保存" class="sbt" />保存</p>
										</div>
									</div>
								</div>
							</li>
							<li class="nick">
								<span>昵称：</span>
								<input type="text" name="nick" id="" value="<?php echo $oldData['nick'];?>" />
							</li>
							<li class="intro">
								<span>介绍：</span>
								<input type="text" name="intro" id="" value="<?php echo $oldData['intro'];?>" placeholder="关于职业、兴趣爱好..." />
							</li>
							<li class="sub">
								<input type="submit" value='保存' />
								<input type="reset" value="取消" class="res" />
							</li>
						</ul>	
					</form>
				</div>
			</div>
		</div>
		<!--页面主体区域end-->
		
		<!--页面底部begin-->
		<div id="footer">
			<div class="foot_wrap">
				<div class="say">
					<p class="p1">“如果你的东西和大家都一样，那干嘛还设计它？”</p>
					<p class="p2">by  Philippe Starck</p>
				</div>
				<div class="foot_logo"></div>
				<p class='infor'>Copyright 2015 版权所有 浙ICP备12027496 <a href="">热门精选</a> <a href="">热门分类</a></p>
				<p class='link'>商务合作  友情链接： 想去网  蘑菇街 360安全网址 爱图购</p>
			</div>
		</div>
		<!--页面底部end-->
	</body>
</html>
